// eslint-disable-next-line @typescript-eslint/no-var-requires
const path = require("path");

module.exports = {
    // 项目根目录
    rootDir: path.join(__dirname, "../../"),

    // 页面目录配置
    dirs: {
        main: "src/packages", // 主包页面目录
        sub: "src/sub-packages", // 分包目录
        output: "src/pages.json" // 输出文件
    },

    // 默认页面样式配置
    defaultPageStyle: {
        navigationBarTitleText: "",
        navigationBarBackgroundColor: "#ffffff",
        enablePullDownRefresh: false
    },

    // 全局样式配置
    globalStyle: {
        navigationBarTextStyle: "white",
        navigationBarTitleText: " ",
        backgroundColor: "#F8F8F8"
    },

    mixins: {
        entryPagePath: "packages/index/index",

        condition: {
            current: 0,
            list: [
                {
                    name: "首页",
                    path: "/packages/index/index"
                },
                {
                    name: "问诊",
                    path: "/packages/diagnosis/index"
                },
                {
                    name: "宠物",
                    path: "/packages/pet/index"
                },
                {
                    name: "我的",
                    path: "/packages/account/index"
                },
                {
                    name: "ta的",
                    path: "/packages/he/index"
                },
                {
                    name: "通知",
                    path: "/packages/notification/index"
                },
                {
                    name: "设置",
                    path: "/packages/setting/index"
                },
                {
                    name: "登录",
                    path: "/packages/login/index"
                }
            ]
        },

        preloadRule: {
            "packages/account/index": {
                network: "all",
                packages: ["sub-packages/account"]
            },
            "packages/diagnosis/index": {
                network: "all",
                packages: ["sub-packages/health"]
            }
        },

        tabBar: {
            custom: true,
            list: [
                {
                    pagePath: "packages/index/index",
                    text: "养宠"
                },
                {
                    pagePath: "packages/community/index",
                    text: "社区"
                },
                {
                    pagePath: "packages/diagnosis/index",
                    text: "问诊"
                },
                {
                    pagePath: "packages/account/index",
                    text: "我的"
                }
            ]
        },

        lazyCodeLoading: "requiredComponents",

        easycom: {
            autoscan: true,
            custom: {
                "^i-(.*)": "@/components/i-$1/index.vue",
                "^uni-(.*)": "@/custom-ui/uni-ui/lib/uni-$1/uni-$1.vue"
            }
        }
    }
};
